
import * as actionTypes from '../action-types'
const actionCreators = { 
    add1(){
        return {type:actionTypes.ADD1}
    },
    minus1 (){
        return {type:actionTypes.MINUS1}
    },
    thunkAdd(){
        return function(getState,dispatch){
            setTimeout(()=>{
                dispatch({type:actionTypes.ADD1})
            },1000)
        }
    },
    promiseAdd(){
        return new Promise((res,rej)=>{
            setTimeout(()=>{
                res({type:actionTypes.ADD1})
            },1000)
        })
    }
}


export default actionCreators